package com.atguigu.gulimall.search.controller;

import com.atguigu.common.to.es.EsSkuUpTo;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.search.service.EsSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhuguanming
 * @description es操作
 * @date 2021/5/26 21:27
 */
@RestController
@RequestMapping("/es/search")
public class EsSearchController {

    @Autowired
    private EsSearchService esSearchService;

    @PostMapping("/bluk/product")
    public R bulkProduct(@RequestBody List<EsSkuUpTo> esSkuUpTos) {
        return esSearchService.bulkProduct(esSkuUpTos);
    }
}
